'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    const now = new Date();
    
    // 初始化菜品评价选项数据
    const dishRatings = [
      // 蔬菜类
      {
        category: '蔬菜类',
        dish_name: '白菜',
        rating_value: '优秀,良好,一般,较差,不合格',
        status: 1,
        create_time: now,
        update_time: now,
        deleted: 0
      },
      {
        category: '蔬菜类',
        dish_name: '土豆',
        rating_value: '优秀,良好,一般,较差,不合格',
        status: 1,
        create_time: now,
        update_time: now,
        deleted: 0
      },
      {
        category: '蔬菜类',
        dish_name: '胡萝卜',
        rating_value: '优秀,良好,一般,较差,不合格',
        status: 1,
        create_time: now,
        update_time: now,
        deleted: 0
      },
      
      // 肉类
      {
        category: '肉类',
        dish_name: '猪肉',
        rating_value: '优秀,良好,一般,较差,不合格',
        status: 1,
        create_time: now,
        update_time: now,
        deleted: 0
      },
      {
        category: '肉类',
        dish_name: '牛肉',
        rating_value: '优秀,良好,一般,较差,不合格',
        status: 1,
        create_time: now,
        update_time: now,
        deleted: 0
      },
      {
        category: '肉类',
        dish_name: '鸡肉',
        rating_value: '优秀,良好,一般,较差,不合格',
        status: 1,
        create_time: now,
        update_time: now,
        deleted: 0
      },
      
      // 水产类
      {
        category: '水产类',
        dish_name: '草鱼',
        rating_value: '优秀,良好,一般,较差,不合格',
        status: 1,
        create_time: now,
        update_time: now,
        deleted: 0
      },
      {
        category: '水产类',
        dish_name: '鲫鱼',
        rating_value: '优秀,良好,一般,较差,不合格',
        status: 1,
        create_time: now,
        update_time: now,
        deleted: 0
      },
      
      // 豆制品类
      {
        category: '豆制品类',
        dish_name: '豆腐',
        rating_value: '优秀,良好,一般,较差,不合格',
        status: 1,
        create_time: now,
        update_time: now,
        deleted: 0
      },
      {
        category: '豆制品类',
        dish_name: '豆芽',
        rating_value: '优秀,良好,一般,较差,不合格',
        status: 1,
        create_time: now,
        update_time: now,
        deleted: 0
      },
      
      // 调味品类
      {
        category: '调味品类',
        dish_name: '酱油',
        rating_value: '优秀,良好,一般,较差,不合格',
        status: 1,
        create_time: now,
        update_time: now,
        deleted: 0
      },
      {
        category: '调味品类',
        dish_name: '醋',
        rating_value: '优秀,良好,一般,较差,不合格',
        status: 1,
        create_time: now,
        update_time: now,
        deleted: 0
      }
    ];

    await queryInterface.bulkInsert('dish_rating', dishRatings, {});
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.bulkDelete('dish_rating', null, {});
  }
}; 